const a: number = 1 // NaN
const b: string = 'foo'
const c: boolean = true // false
const d: void = undefined
const e: null = null
const f: undefined = undefined
// const g: symbol = Symbol()

// 剩余参数语法允许我们将一个不定数量的参数表示为一个数组 ...args
const arr1: Array<number> = [1, 2, 3]
const arr2: number[] = [1, 2, 3]
function sum(...args: number[]) {
  // 确保每个参数都是数字
  return args.reduce((prev, current) => prev + current, 0)
}
console.log(sum(1, 2, 3))
console.log('tsdemo', sum(1, 2, 3))
